#!/bin/bash

systemctl stop hotStandbyStatusMonitor.service
systemctl disable hotStandbyStatusMonitor.service
rm /etc/systemd/system/hotStandbyStatusMonitor.service
rm /lib/systemd/system/hotStandbyStatusMonitor.service
systemctl daemon-reload

# 如果当前系统是CentOS 则用yum下载keepalived 反之用apt
if [ -f /etc/centos-release ] ||
   { [ -f /etc/redhat-release ] && grep -qi "centos" /etc/redhat-release; } ||
   { [ -f /etc/os-release ] && (grep -q "ID=\"centos\"" /etc/os-release || grep -q "ID=centos" /etc/os-release); }; then
    yum remove keepalived
else
    apt remove keepalived
fi

# 卸载python窗口程序依赖
pip3 uninstall PySide6

INSTALL_PATH="/home/gonsin/venus/hotStandbyStatusMonitor"
if [ -d $INSTALL_PATH ]; then
   rm -rf $INSTALL_PATH
fi